<template>
    <el-form ref="form" :model="form" label-width="80px">
        <div class="flex">
            <el-form-item label="选择模块" class="model">
                <el-select :popper-append-to-body="false" v-model="form.value" placeholder="请选择">
                    <el-option v-for="item in modelsArr" :key="item.value" :label="item.assemblyName"
                        :value="item.assemblyId">
                    </el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="选择工件" class="model">
                <el-select :popper-append-to-body="false" v-model="form.value1" placeholder="请选择">
                    <el-option v-for="item in options" :key="item.value" :label="item.workpieceName"
                        :value="item.workpieceId">
                    </el-option>
                </el-select>
            </el-form-item>
        </div>

        <el-form-item label="解决方案" class="model">
            <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">添加</el-button>
        </el-form-item>
    </el-form>
</template>
<script>
import { savePaln } from '@/api/fulitModelApi/index.js'
export default {
    props: ["options", "modelsArr", "except"],
    data() {
        return {


            form: {
                desc: "",
                value: '',
                value1: '',
            }
        }
    },
    mounted() {

    },
    methods: {
        onSubmit() {
            savePaln({
                planId: this.form.value1,
                exceptId: this.except.exceptId,
            }).then((res) => {
                if (res.code !== 200) {
                    this.$emit("errorFun", res)
                }
                this.$emit("ftorub")
            })
        }
    },
}
</script>
<style lang="less" scoped>
.el-scrollbar {
    background: #010612 !important;
}

.el-select {
    width: 100px;
}

.el-textarea /deep/ textarea {
    background-color: #010612;
    color: white;
    opacity: 1;
    border: 0px solid #5B9FC3;
    height: 151px;
}

.el-input--suffix .el-input__inner {
    width: 100%;
}

.el-select-dropdown {
    width: 100px !important;
    background: #010612 !important;
    color: white !important;
    border: 0px;
    z-index: 2023;

    .el-select-dropdown__list {
        background-color: #031231;
    }
}

/deep/.el-input__inner {
    background-color: rgba(108, 113, 127, 30%);
    border: 1px solid rgba(13, 43, 81, 0.1);
    color: rgba(116, 116, 116, 1);
    padding: 0 0px 0 5px;
    font-size: 12px;
    border-radius: 0px;
}

.el-select-dropdown__item {
    background-color: rgba(108, 113, 127, 30%);
    border: 1px solid rgba(13, 43, 81, 0.1);
    color: rgba(116, 116, 116, 1);
    padding: 0 0px 0 5px;
    font-size: 12px;
    border-radius: 0px;
    z-index: 2023;
}

.el-select-dropdown__item.hover,
.el-select-dropdown__item:hover {
    background-color: #010612;
    color: white;
    opacity: 1;
    border: 0px solid #5B9FC3;
}

.el-popper[x-placement^=bottom] {
    background-color: #010612;
    color: white;
    opacity: 1;
    border: 0px solid #5B9FC3;
}

.el-form /deep/ .model {
    display: flex;
    flex-direction: row;
}

.el-inputmode {
    margin-left: 0px !important;

    /deep/ input {
        background: none !important;
    }
}

.el-form .model /deep/ .el-form-item__label {
    width: 85px !important;

}

.flex {
    display: flex;
    justify-content: normal;
    height: 71px;
}

.el-color-picker__icon,
.el-input,
.el-textarea {
    height: 100%;
}

.el-form-item {
    margin-bottom: 0px;
}

.el-form-item {
    display: flex;
    flex-direction: column;
}

.el-input {
    width: 82%;
    margin-left: 31px;
}


.el-form-item /deep/ .el-form-item__content {
    margin-left: 0px !important;
    width: 60%;
}

.el-form-item /deep/ .el-form-item__label {
    width: 60% !important;
    text-align: left;
    color: white;
    margin-left: 20px;
    line-height: 40px;

}

.el-button--primary {
    width: 100px;
    height: 40px;
    background: #010612;
    opacity: 1;
    border: 1px solid #5B9FC3;
    margin: 10px 40%;
}
</style>